<?php

class Video_process extends CI_Model {//这里关于admin表的一些操作和登录判定

    const Statustrue = True;
    const Statusflase = False;

    function __construct() {
        parent::__construct();
        $this->load->library('file_upload'); //引入类库
        $this->load->model('alblum_process');
    }

    function video_list() {
        $sql = "select * from photos where type=1";
        $query = $this->db->query($sql);
        return $res = $query->result_array();
    }

    function get_video_type_array() {//生成视频类型的数组
        $video_type_array = $this->alblum_process->album_type_array(1);
        $array_vedio_type = array();
        foreach ($video_type_array as $key => $val) {
            $array_vedio_type[$val["id"]] = $val["title"];
        }
        return $array_vedio_type;
    }

    function add_vedio($post_array) {
        //  print_r($post_array);
        $insert_sql = "insert into photos(album_id,title,`desc`
,path,type,`order`,vediocover
)values(\"{$post_array["album_id"]}\",\"{$post_array["title"]}\",\"{$post_array["desc"]}\",\"{$post_array["path"]}\",\"{$post_array["type"]}\",\"{$post_array["order"]}\"
    
,\"{$post_array["full_path"]}\"
)";
        $this->db->query($insert_sql);

//$config['upload_path'] = './uploads/photos'; //设定上传存储路径
// $data = $this->file_upload->upLoadfile($config, "cover");
    }
    
  
    

}

?>
